package day07.Collection;

import java.util.ArrayList;
import java.util.Iterator;

public class Lian03 {
    public static void main(String[] args) {
        ArrayList<String >list=new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        Iterator<String> it = list.iterator();
        while (it.hasNext()){
            String s = it.next();
            if ("a".equals(s)){
                it.remove();
            }
        }
        System.out.println(list);
        System.out.println("----------");
        for (String s : list) {
            System.out.println(s);
        }
    }
}
